Accusoft.OCRXpress.Java - Updated
Memory Management and Reference Counting
User Guide > Concepts > Memory Management and Reference Counting

OCR Xpress for Java automatically manages the memory allocation of internal objects through reference counting. References are counted on each OcrXpress object and each Result object independently.

How long does the OcrXpress object stay in memory?

Once the object is set to null, it will be cleaned up by the garbage collector.

How long does a Result object stay in memory?

Document object is returned from the recognizeToMemory() method. Every time a result of the Document is accessed the reference count is increased. As long as the child objects remain in scope, or are not set to null, the reference is retained.